package cn.wzy.es_demo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @Author
 * @Date 2021/10/26 15:24
 * @Description
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "product_index" )
public class ProEs {
    @Id
    @Field
    private Integer proId;

    @Field(type = FieldType.Text ,analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String proName;

    @Field(type = FieldType.Text , analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String proDesc;

    @Field(type = FieldType.Double)
    private Double price;
}
